<?php

class client_account{
	
	// Define variables
	private $ID_CLIENT_ACCOUNT;
	private $CLIENT_ID;
	private $ACCOUNT_ID;
	
	// Connection with database and instance creation
	private $DB;
	public function __construct() {
		$config = config::getInstance();
		$this->DB = $config->config_values['database']['db_prefix'];
	}
	
	// Getters and setters functions
  	public function setID_CLIENT_ACCOUNT($value) {
  		$this->ID_CLIENT_ACCOUNT = $value;
  	}
	public function getID_CLIENT_ACCOUNT() {
  		return $this->ID_CLIENT_ACCOUNT;
  	}
	public function setCLIENT_ID($value) {
  		$this->CLIENT_ID = $value;
  	}
	public function getCLIENT_ID() {
  		return $this->CLIENT_ID;
  	}
	public function setACCOUNT_ID($value) {
  		$this->ACCOUNT_ID = $value;
  	}
	public function getACCOUNT_ID() {
  		return $this->ACCOUNT_ID;
  	}

	// General functions:
  	public function load($id)
	{
		$db = db::getInstance();
		$sql = "SELECT * FROM ".$this->DB."client_account WHERE ID_CLIENT_ACCOUNT=".$id;

		foreach ($db->query($sql) as $row) {
			$this->setID_CLIENT_ACCOUNT($row['ID_CLIENT_ACCOUNT']);
			$this->setCLIENT_ID($row['CLIENT_ID']);
			$this->setACCOUNT_ID($row['ACCOUNT_ID']);
		}
	    $db = null; 
	    return true;			
  	}

  	public function insert(){}

  	public function modify($id){}

  	public function delete($id){}
  	
}
?>